import xhr from '../request';

export type UserInfo = {
  CreatedAt: string | null
  DeletedAt: string | null
  Encrypt: string
  ID: number
  LoginName: string
  Password: string
  UpdatedAt: string | null
}

export default {
  login(data: { LoginName: string, Password: string }) {
    return xhr.request<{ token: string }>({ method: 'post', url: '/V1/Member/Login', data })
  },

  getUserInfo() {
    return xhr.request<UserInfo>({ method: 'get', url: '/V1/Member/GetCurrentMemberInfo' })
  },

  updatePassword(data: { OldPassword: string, Password: string }) {
    return xhr.request({ method: 'post', url: '/V1/Member/UpdatePassword', data })
  },

};
